package com.logic.saas.util;

import org.apache.log4j.Logger;

public class AddLog {
	public static final int DEBUG = 1;
	public static final int INFO = 2;
	public static final int WARN = 3;
	public static final int ERROR = 4;

	public static void addToLog(Class classes,int level, String message) {
		Logger logger = Logger.getLogger(classes);
		switch (level) {
		case 1:
			logger.debug(message);
			break;
		case 2:
			logger.info(message);
			break;
		case 3:
			logger.warn(message);
			break;
		case 4:
			logger.error(message);
			break;
		}
	}
	
	public static void debug(Class classes,String message){
		Logger logger = Logger.getLogger(classes);
		logger.debug(message);
	}

	public static void info(Class classes,String message){
		Logger logger = Logger.getLogger(classes);
		logger.info(message);
	}
	public static void warn(Class classes,String message){
		Logger logger = Logger.getLogger(classes);
		logger.warn(message);
	}

	public static void error(Class classes,String message){
		Logger logger = Logger.getLogger(classes);
		logger.error(message);
	}

}
